class Solution {
public:
	bool isPalindrome(ListNode* head) {
		vector<int>arr;
		while(head != NULL) {
			arr.push_back(head->val);
			head = head->next;
		}
		for (int i = 0, j = arr.size() - 1; i < j; i++, j--) {
			if (arr[i] != arr[j]) { return false; }
		}
		return true;
	}
};